package com.gongzhiyun.springboot3test.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * swagger配置
 *
 */
@Configuration
@RequiredArgsConstructor
public class SwaggerConfig {
    @Bean
    public OpenAPI customOpenAPI() {
        OpenAPI openAPI = new OpenAPI();
        // 联系人信息
        Contact contact = new Contact();
        contact.setName("gongzhiyun");
        contact.setEmail("2505686754@qq.com");
        contact.setUrl("https://gongzhiyun.fun");
        Info info = new Info();
        info.contact(contact);
        // 基本信息
        info.title("疯狂大笑");
        info.version("1.0.0");
        info.description("");
        info.termsOfService("https://gongzhiyun.fun");
        openAPI.info(info);
        return openAPI;
    }

}